import {createRouter,createWebHashHistory} from 'vue-router'
// 接下来导入路由

import register from "../views/register.vue"
import login from '../views/login.vue'
import resetPassword from '../views/resetPassword.vue'
import notfound from '../views/notfound.vue'

const routes =[
    {
        path:'/',
        component:login
    },
    {
        path:'/register',
        component:register
    },
    {
        path:'/resetPassword',
        component:resetPassword
    },
    {
        path: '/:pathMatch(.*)*',  // 匹配所有未定义的路由
        component: notfound
    }
]

const router = createRouter({
    //createWebHistory无#
    //该方式需要后端配合，使用重定向
    history:createWebHashHistory(),
    routes
})

//导出
export default router;